﻿using Core.Tools.IOC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UI.Application.Share.Reactor;

namespace UI.Application.Reactor.Services
{
    /// <summary>
    /// 反应釜下发的指令生成工厂
    /// </summary>
    [ExposedService(Lifttime.Singleton,typeof(IReactorCommandFactory))]
    public class ReactorCommandFactory : IReactorCommandFactory
    {
        /// <summary>
        /// 生成一个反应釜指令集对象
        /// </summary>
        /// <param name="reactorName">反应釜名称</param>
        /// <returns></returns>
        public IReactorCommandManager CreateReactorCommandManager(ReactorName reactorName)
        {
            IReactorCommandManager command = new ReactorCommandManager();
            switch (reactorName)
            {
                case ReactorName.None:
                    return command;
                case ReactorName.Reactor1:
                    command.HeatAddress = 32;
                    command.CoolAddress = 34;
                    break;
                case ReactorName.Reactor2:
                    command.HeatAddress = 33;
                    command.CoolAddress = 35;
                    break;
                default: return command;
            }
            return command;
        }
    }
}
